package titt.server.service;

import titt.io.socket.TITTSocket;
import titt.key.TITTKey;
import titt.server.service.listener.ServiceListener;
import titt.service.ServicePackage;

public interface Service extends Comparable<Service> {

	String[][] getRegistrationInterface();
	long lastSuccess();

	void addDependency(TITTSocket ts) throws Exception;
	void removeDependency(TITTSocket ts) throws Exception;
	
	ServicePackage withdraw() throws Exception;
	void deposit(ServicePackage pack);
	void sync(ServicePackage pack);
	
	void stop() throws Exception;

	void attachServiceListener(ServiceListener sl);
	void removeServiceListener(ServiceListener sl);
	
	void waitForCompletion(int maxSec) throws Exception;

	String getID();
	TITTKey getKey();
}
